home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 2948 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.1 KB

  1. Path: Rezonet.net!news
  2. From: ray@ultimate-tech.com (Ray Dunn)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: * ISR handlers (interrupt handlers) *
  5. Date: 25 Jan 1996 04:42:50 GMT
  6. Organization: Ultimate Technographics Inc.
  7. Message-ID: <4e71oa$dvl@ns.RezoNet.NET>
  8. References: <4e6e5i$ddc@acmex.gatech.edu>
  9. NNTP-Posting-Host: 204.19.230.7
  10. Mime-Version: 1.0
  11. Content-Type: Text/Plain; charset=US-ASCII
  12. X-Newsreader: WinVN 0.99.7
  13.  
  14. In referenced article, Israel Denis Jr. says...
  15. >Does anyone know where I can find some information to 
  16. >code and ISR (interrupt service routine), in c of course.
  17. >I have seen ISR information in ASSEMBLY. But I don't 
  18. >know assembly. 
  19.  
  20. This is a very system specific question.  There are several real 
  21. problems that you have to overcome:
  22.  
  23. 1.  Planting the address of your 'C' ISR routine in the interrupt
  24.     vector.
  25. 2.  Ensuring that the correct stack is used during the execution
  26.     of your code.
  27. 3.  Getting the system specific information that will be passed to
  28.     your ISR when it is executed.
  29. 4.  Ensure the correct exit sequence to restore the machine state.
  30.  
  31. In addition, you may have to involve yourself with modifying the 
  32. priority levels of the interrupt chain, and reading and writing status, 
  33. data and control information from I/O ports or memory mapped I/O 
  34. locations.
  35.  
  36. All of this is system specific.
  37.  
  38. If you are doing this on a Unix system, (I should say *inside* a Unix 
  39. system), you need the hardware details of the machine you are running 
  40. on, a Unix system development environment, and manuals on how to write 
  41. device drivers. 
  42.  
  43. If you want to do it in DOS, it might be easier.  There are various 
  44. "API" calls to allow you to plant your routine address in the interrupt 
  45. vector, and return safely, etc - see the descriptions of the DOS 
  46. specific function calls in the library manual that comes with your 
  47. compiler.
  48.  
  49. In Windows, you can only do it if you have the appropriate Device 
  50. Driver Development Kit - but that will give you all the info you need.
  51. -- 
  52. Ray Dunn (opinions are my own) | Phone: (514) 938 9050
  53. Montreal                       | Phax : (514) 938 5225
  54. ray@ultimate-tech.com          | Home : (514) 630 3749
  55.  
  56.